package day04;

import java.util.Scanner;

public class CommandBySwitch {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请选择功能：1.取款 2.存款 3.查询余额 0.退卡");
        int command = scanner.nextInt();
       /* switch (command) {
            case 1:
                System.out.println("取款操作。。。");
                break;
            case 2:
                System.out.println("存款操作。。。");
                break;
            case 3:
                System.out.println("查询余额。。。");
                break;
            case 0:
                System.out.println("退卡操作中。。。");
                break;
            default:
                System.out.println("输入错误");
        }

        */
        switch (command){
            case 1:
                System.out.println("取款中...");
                break;
            case 2:
                System.out.println("存款中。。。");
                break;
            case 3:
                System.out.println("查询余额");
                break;
            case 0:
                 System.out.println("退卡操作中。。。");
                 break;
            default:
                System.out.println("输入错误");
        }

        switch (command){
            case 1:
                System.out.println("取款中。。。");break;
            case 2:
                System.out.println("存款中。。。");break;
            case 3:
                System.out.println("查询余额。。。");break;
            case 0:
                System.out.println("退卡操作中。。。");break;
            default:
                System.out.println("输入错误");
        }

        /**
         * 转换 if else
         */
        if (command == 1) {
            System.out.println("取款操作。。。");
        } else if (command == 2) {
            System.out.println("存款操作。。。");
        } else if (command == 3) {
            System.out.println("查询余额。。。");
        } else if (command == 0) {
            System.out.println("退卡操作中。。。");
        } else {
            System.out.println("输入错误");
        }
    }

}
